"use strict"

var dataDebug=1;
var _rootRestUrl= '/xbay/webresources/'




$(document).ready(function() {
    $("#INJECT_TEST").html("<h1> Hello World from jquery </h1>");
    
    dataGetWs('thirdPartyProduct', function(data){
         
        if(data==null){
            return;
        }
        var htmlToInject='';
        for(var i=0; i<data.length; i++){
            var item = data[i];
            var img = item.images!=undefined?item.images:'';
            
            htmlToInject+='<tr>\n\
                                <td>id: '+item.id+'</td>\n\
                                <td>name: '+item.name+'</td>\n\
                                <td>descr: '+item.descr+'</td>\n\
                                <td>tags: '+item.tags+'</td>\n\
                                <td>price: '+item.price+'</td>\n\
                                <td><img src="'+img+'"/></td>\n\
                            </tr>';
        }
        
        $("#PRODUCT_LIST").html(htmlToInject);
    /*
        $.each( data, function( key, value ) {
            console.log(key+": "+value);
        });
        //*/
    })
    
});



